<?php

    if ( !defined ( 'BASEPATH' ) )
        exit ( 'No direct script access allowed' );

    if ( !function_exists ( 'array_std' ) )
    {

        /**
         * Convert an array into a stdClass()
         * 
         * @param   array   $array  The array we want to convert
         * 
         * @return  object
         */
        function array_std ( $array )
        {
            // First we convert the array to a json string
            $json = json_encode ( $array );

            // The we convert the json string to a stdClass()
            $object = json_decode ( $json );

            return $object;
        }

    }
?>
